﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebFormAppNet40
{
    public partial class _Default : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            using (var conn = new SqlConnection(ConfigurationManager.ConnectionStrings["CMAPE"].ConnectionString))
            {
                var sql = "select * from T_MGT_System";
                conn.Open();
                var cmd = conn.CreateCommand();
                cmd.CommandText = sql;

                var datatable = new DataTable();
                var adapter = new SqlDataAdapter(cmd);
                adapter.Fill(datatable);

                this.gvSystemList.DataSource = datatable;
                this.gvSystemList.DataBind();
            }
        }
    }
}